package com.hornsun.domain.constant.types;

/**
 * 所有资源信息的总类型：商品/资讯/活动
 * Created by 编译中... on 2018/4/13.
 */
public enum InfoType {
    INFORMATION(1,"资讯"),
    COMMODITY(2,"商品"),
    ACTIVITY(3,"活动");

    private Integer type;
    private String name;

    InfoType(Integer type ,String name){this.type=type;this.name=name;}

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static InfoType fromName(String name) {
        for (InfoType infoType : values()) {
            if (infoType.name.equals(name) ) {
                return infoType;
            }
        }
        return null;
    }

}
